package com.miaosmart.tools;

import com.miaosmart.entity.MatchRecord;
import com.miaosmart.service.IMatchRecordService;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.stereotype.Component;

import java.util.List;



@RequiredArgsConstructor
@Component
public class GameRecordTools {

    private final IMatchRecordService matchRecordService;


    @Tool(description = "根据游戏ID获取游戏战绩")
    public List<MatchRecord> getGameRecord(@ToolParam(description = "游戏ID") String gameId) {
        return matchRecordService.query().eq("game_id", gameId)
                .orderBy(true, false, "created_at")
                .list();

    }

}
